import React, {Component} from 'react';
import {connect} from 'react-redux';
import './artRDetail.scss';

class ArticlesRecommendDetail extends Component {

    render() {
        return (

            <div className=''>
                {this.props.recom &&this.props.recom.map((item, key) =>
                    <div className='aRDcon' key={key}>
                        <div className='aRDleft'>
                            <p className='aRDleftTitle'>{item.arTitle}</p>
                            <p className='aRDleftContent'>{item.arContent}</p>
                            <div className='looknlike'>
                                <div className='look'><i className='iconfont'>&#xe6e4;</i><span>{item.arRead}</span></div>
                                <div className='like'><i className='iconfont'>&#xe707;</i><span>{item.arLike}</span></div>
                            </div>
                        </div>
                        <div className='aRDright'>
                            <img src={item.arImg} alt="图片"/>
                        </div>
                    </div>
                )}
            </div>



        )
    }

}

const mapStateToProps = (state) => {
    let recom = state.proArticles.recom;
    if (recom) {
        //console.log(recom);
        return {
            recom
        }
    } else {
        return {}
    }
}
export default connect(mapStateToProps)(ArticlesRecommendDetail)